package org.yenn.pattern.aliyun.j2ee.compositeentity;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

import static org.junit.Assert.*;

/**
 * @Author: yerenyun
 * @Description:步骤 5
 * 使用 Client 来演示组合实体设计模式的用法
 */
@Slf4j
public class CompositeEntityPatternDemo {
    /**
     * 步骤 6
     * 验证输出。
     *
     * Data: Test
     * Data: Data
     * Data: Second Test
     * Data: Data1
     */
    @Test
    public void printData() {
        Client client = new Client();
        client.setData("Test", "Data");
        log.info("client={}",client);
        client.printData();

        client.setData("Second Test", "Data1");
        log.info("client={}",client);
        client.printData();
    }
}